package string;

public class Demo02 {
    public static void main(String[] args) {
        /*
        字符串APi方法：
            字符串中每个字符都有下标序号，下标序号从0开始
            charAt(index) 返回字符串中指定位置的字符
            length() 返回字符串中字符的个数
         */
        String s = "ABC";
        char c = s.charAt(1);
        int l = s.length();
        System.out.println(c);
        System.out.println(l);

        String str = "Thinking in Java 123456";
        int sum = 0;
        for (int i=0;i<str.length();i++){
            char ch = str.charAt(i);
                if (ch >='a' && ch<='z'){
                    sum++;
                }
        }
        System.out.println(sum);
    }
}

